package com.example.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/list")
public class hello {

    @GetMapping("/hello")
    public String hello(){
        return "index.html";
    }

//    @PathVariable(name = "id") String id,   http://localhost:8080/demo/123
//    @RequestParam("id") String id,          http://localhost:8080/demo?id=xiaoshitou
//    访问方式不同

    @GetMapping("/demo")
    public void demo(@RequestParam("id") String id, @RequestParam("name") String name){
        System.out.print("id = " +id);
        System.out.print("name = " +name);
    }
}
